class code3 {
    //盛最多水的容器
    public int maxArea(int[] height) {
        int right = height.length-1;
        int left = 0;
        int V = 0;
        while(left<right) {
            V = Math.max(V,Math.min(height[left],height[right])*(right-left));
            //谁小谁动
            if(height[left]<height[right]) {
                left+=1;
            } else {
                right-=1;
            }
        }
        return V;
    }
}